From: Andrew Choi Date: Tue, 4 Sep 2001 06:12:57 +0000 (+0000) Subject: 2001-09-04 Andrew Choi X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~62207 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=bc04fb2cf2a5993e12ca561461fc7763028d1c32;p=emacs.git 2001-09-04 Andrew Choi * src/mac.c (sleep) [__MRC__]: Place loop around WaitNextEvent to check time elapsed instead of use WaitNextEvent call as a delay. --- diff --git a/mac/ChangeLog b/mac/ChangeLog index fd259a54609..1ae1c7fdca8 100644 --- a/mac/ChangeLog +++ b/mac/ChangeLog @@ -9,7 +9,9 @@ * src/mac.c (stat): Don't fail for aliases. (sys_open) [__MRC__]: Set file creator and type for newly-created files. - + (sleep) [__MRC__]: Place loop around WaitNextEvent to check time + elapsed instead of use WaitNextEvent call as a delay. + 2001-08-24 Andrew Choi * src/macterm.c (init_font_name_table): Add an additional entry to diff --git a/mac/src/mac.c b/mac/src/mac.c index 0aaad884f6d..d0c9d1a36c3 100644 --- a/mac/src/mac.c +++ b/mac/src/mac.c @@ -969,9 +969,15 @@ gettimeofday (tp) unsigned int sleep (unsigned int seconds) { + unsigned long time_up; EventRecord e; - WaitNextEvent (0, &e, seconds * 60UL, NULL); /* Accept no event; just wait. by T.I.*/ + time_up = TickCount () + seconds * 60; + while (TickCount () < time_up) + { + /* Accept no event; just wait. by T.I. */ + WaitNextEvent (0, &e, 30, NULL); + } return (0); }